/**
 * 
 */
package examples.interceptor;

import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;

/**
 * @author Jesus Barreto jj_b_f@yahoo.com.mx
 * 
 */
public class LoggerInterceptor {

	@AroundInvoke
	public Object logger(InvocationContext inv) throws Exception {
		System.out.println("LoggerInterceptor - Intercepted call via " + "external class to: "
				+ inv.getMethod().getName());
		Object[] params = inv.getParameters();
		for (int i = 0; i < params.length; i++) {
			System.out.println("\tparam: " + params[i]);
		}
		return inv.proceed();
	}
}
